Skip to content

Instantly share code, notes, and snippets.

@tablekat
tablekat / main.ts
Created June 30, 2016 20:24
Making gmail push notifications to webhook
import * as request from 'request';
import * as fs from 'fs';
import * as readline from 'readline';
var google = require('googleapis');
var googleAuth = require('google-auth-library');
/*************** STEPS
- made a project on https://console.cloud.google.com/cloudpubsub/topicList?project=testmabs thing?
@mrliptontea
mrliptontea / sublime-text-3-windows-shortcuts.md
Last active March 15, 2024 14:28 — forked from TheShrike/gist:6111200
Sublime Text 3 - Useful Shortcuts (Windows)

Sublime Text 3 - Useful Shortcuts (Windows)

General

Shortcut Description
Ctrl+Shift+P command prompt
Ctrl+Alt+P switch project
Ctrl+P go to file
Ctrl+G go to line
@jNizM
jNizM / gist:79aa6a4b8ec428bf780f
Last active September 17, 2022 08:27
[AHK] AES Encryption (String)
/*
Update v0.4
Todo: - CryptSetKeyParam (KP_MODE with CBC [maybe CFB, ECB, OFB or CTS])
*/
MsgBox % enc := AES.Encrypt("Test String", "testpw", 256)
MsgBox % AES.Decrypt(enc, "testpw", 256)
Class AES
{
@ttscoff
ttscoff / bytes.rb
Created November 2, 2014 15:34
Convert file sizes between human-readable and machine representations
#!/usr/bin/ruby
module Bytes
def to_human(n,fmt=false)
count = 0
formats = %w(B KB MB GB TB PB EB ZB YB)
while (fmt || n >= 1024) && count < 8
n /= 1024.0
@jcppkkk
jcppkkk / OpenWithSublime.bat
Last active June 25, 2023 22:07 — forked from FoxColdMetal/OpenWithSublimeText.bat
[[[ Move to https://github.com/jcppkkk/OpenWithSublime !!! ]]] Add context menu to allow user open file or folder with Sublime as User (or as Admin).
@echo off
:: Path to Sublime Text installation dir.
SET stPath=%~dp0sublime_text.exe
SET stPathOnly=%~dp0
:: Key name for the registry entries.
SET UserEntry=Sublime Text
SET AdminEntry=Sublime Text As Admin
:: Context menu texts.
SET "UserMenuText=Open with Sublime(&-)"
SET "AdminMenuText=Open with Sublime As Admin(&+)"
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@velocityzen
velocityzen / auth.py
Created September 26, 2011 16:30
This script take pictures from directory and post it to tumblr blog and then delete it. Tumblr API v2! This example for oath file upload.
import urlparse
import oauth2 as oauth
consumer_key = ''
consumer_secret = ''
request_token_url = 'http://www.tumblr.com/oauth/request_token'
access_token_url = 'http://www.tumblr.com/oauth/access_token'
authorize_url = 'http://www.tumblr.com/oauth/authorize'