Skip to content

Instantly share code, notes, and snippets.

@andres-erbsen
andres-erbsen / gist:1307745
Created October 23, 2011 19:15
Bash script to install firefox extension xpi (for all users by default)
#!/bin/bash
EXTENSIONSDIR="/usr/lib/firefox-addons/extensions"
TMP="/tmp/firefox-extension-install-temp"
[ x"$1" == "x" ] || [ ! -f $1 ] && echo "Specify valid .xpi file as argument." && exit 1
sudo rm -rf $TMP 2>/dev/null
mkdir -p "$TMP"
trap "sudo rm -rf $TMP 2>/dev/null" 1 2 3 15
@jocopa3
jocopa3 / CommandRequest.js
Created February 11, 2017 18:46
MCPE/Win10 WebSocket JSON Messages
// For more information about available commands, look at the commands/standard.json file in the game's assets.
{
"body": {
"input": {}, // Command inputs go here
"origin": {
"type": "player" // Where the command originates from
},
"name": "name-of-command", // Command name goes here (i.e. for /say, enter "say")
"version": 1,
@vinoski
vinoski / sws.erl
Last active January 12, 2024 14:59
An example of a very simple HTTP 1.0 web server in Erlang.
%% Simple web server.
-module(sws).
-author('Steve Vinoski <[email protected]>').
-export([start/1, start/2]).
%% start/1 takes a handler function and starts the web server on port 8000.
%% start/2 takes a handler function and a port number. The handler function
%% takes two arguments: a TCP socket and request data. The request data is
%% a property list indicating the invoked HTTP method, the target URI, the
@kinu
kinu / how_i_got_into_google.md
Last active January 16, 2025 08:17
Google に入るまでの話

Google に入ったときの話 (Kinuko)

祭っぽいので私も書いてみることにした!お手軽に gist で。

コンテキスト:https://togetter.com/li/1331865

対策とか(特になし)

と書き出したはいいが、私が受けたときは本も情報もあまりなく、かつ競プロ的なものの存在も知らなかったので、とりあえず家にあったアルゴリズムの本を2回くらい読み直した。そして受かった。最初っから情報があまりない方のパターンで申し訳ない 😄

@iann0036
iann0036 / gist:b473bbb3097c5f4c656ed3d07b4d2222
Last active January 16, 2025 08:16
List of expensive / long-term effect AWS IAM actions
route53domains:RegisterDomain
route53domains:RenewDomain
route53domains:TransferDomain
ec2:ModifyReservedInstances
ec2:PurchaseHostReservation
ec2:PurchaseReservedInstancesOffering
ec2:PurchaseScheduledInstances
rds:PurchaseReservedDBInstancesOffering
dynamodb:PurchaseReservedCapacityOfferings
s3:PutObjectRetention
@benclmnt
benclmnt / advice.md
Last active January 16, 2025 08:16
NUS CS Planning

Module Planning

Here be some of my notes on how to plan your CS career (specifically NUS).

First things first, I encourage you to have your own module plan (say, in a Google Sheets). You can start with the suggested module plan, but they are quite generic and might not suit your personal goals (e.g. some advanced modules you'd like to take have prerequisites that are offered in odd semesters only).

Having your own module plan will also make you easier to include other non-academic activities too.

General advice

  • Take as many foundational (core) modules while you can. You never want to be left behind due to missing prerequisites.
@takekazuomi
takekazuomi / csharp.gitignore
Created April 17, 2014 05:47
.gitignore for C#
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
@CMCDragonkai
CMCDragonkai / regular_expression_engine_comparison.md
Last active January 16, 2025 08:13
Regular Expression Engine Comparison Chart

Regular Expression Engine Comparison Chart

Many different applications claim to support regular expressions. But what does that even mean?

Well there are lots of different regular expression engines, and they all have different feature sets and different time-space efficiencies.

The information here is just copied from: http://regular-expressions.mobi/refflavors.html

@karpathy
karpathy / min-char-rnn.py
Last active January 16, 2025 08:13
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)