Skip to content

Instantly share code, notes, and snippets.

@sandfox
sandfox / CertificateGeneration.sh
Created February 15, 2012 00:11
TLS certificate inspection example (using nodejs)
###
#Step 1 - Generate server certificates etc... (most of this code is horribly ripped off from nodejs docs currently -> http://nodejs.org/docs/latest/api/tls.html)
###
#Assuming your starting from a clean directory
mkdir server
cd server
#generate private key
@nicdoye
nicdoye / mysqlbackup.sh
Created February 2, 2013 13:07
Backup your OpenShift MySQL database. My DB is only small so I didn't bother to compress it through a pipe. sftp it back from your local machine afterwards This is basically a quick hack from running "type mysql" on the OpenShift gear - hint: it's a bash function/alias
mkdir ~/app-root/data/tmp
mysqldump -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} --password="$OPENSHIFT_MYSQL_DB_PASSWORD" --all-databases > ~/app-root/data/tmp//all.sql
@EvilFreelancer
EvilFreelancer / builder.sh
Created November 10, 2018 16:15
Upwork on NixOS
#!/bin/sh
source $stdenv/setup
PATH=$dpkg/bin:$PATH
dpkg -x $src unpacked
cp -r unpacked/* $out/
const puppeteer = require("puppeteer");
const opn = require("opn");
const nodemailer = require("nodemailer");
const timeout = 5000;
const waitForTimeout = 1000;
const cartLink =
"https://store.nvidia.com/store/nvidia/en_US/buy/productID.5438481700/clearCart.yes/nextPage.QuickBuyCartPage";
@artalar
artalar / map_typed.ts
Last active September 22, 2022 07:35
type M = [any, any];
type Delete<k, m extends M> = k extends m[0]
? m extends [k, any]
? never
: m
: m[0] extends k
? [unknown, unknown]
: m;
type Add<k, v, m extends M> = [k, v] | Delete<k, m>;
type Get<k, m extends M> = k extends m[0]
@max-mykhailenko
max-mykhailenko / # Sublime Emmet JSX Reactjs.md
Last active November 25, 2022 23:25
Sublime text 3. Enable Emmet in JSX files with Sublime React plugin

This is no longer needed as Emmet supports JSX - you just need to turn it all on. Did a quick tutorial: http://wesbos.com/emmet-react-jsx-sublime/

Thanks, @wesbos

Problem

  • Using emmet in jsx files
  • Emmet expands text when js autocomplete needed
//META{"name":"SendEmbeds"}*//
function SendEmbeds() {
return;
}
SendEmbeds.prototype.load = function() {};
SendEmbeds.prototype.unload = function() {};
@Marak
Marak / dockerCheatSheet.md
Last active October 31, 2023 20:48
docker cheat sheet

Things I wish I knew before I started using Docker

Commands

Init docker on mac os

boot2docker init

Restart docker vm on mac os

boot2docker up
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net