Skip to content

Instantly share code, notes, and snippets.

View Shuky's full-sized avatar
💭
I may be slow to respond.

shukshuk Shuky

💭
I may be slow to respond.
View GitHub Profile
@Shuky
Shuky / gist:862344edd50faa96fc88b5b887263b8f
Created August 21, 2017 14:29 — forked from mhawksey/gist:1170597
Google Apps Script to fill in a Document template with Spreadsheet data
function onOpen() {
var menuEntries = [ {name: "Create Diary Doc from Sheet", functionName: "createDocFromSheet"}];
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.addMenu("Fitness Diaries", menuEntries);
}
function createDocFromSheet(){
var templateid = "1O4afl8SZmMxMFpAiN16VZIddJDaFdeRBbFyBtJvepwM"; // get template file id
var FOLDER_NAME = "Fitness Diaries"; // folder name of where to put completed diaries
// get the data from an individual user
@Shuky
Shuky / dynamic_fb_audience_network_sdk_example.js
Last active June 8, 2016 21:04
Facebook Audience Network
//creates a facebook ad html element on the dom
function createFacebookAdElement(placementId) {
var adElemWrap = document.createElement('div');
adElemWrap.innerHTML = '<div class="fb-ad center" data-format="300x250" data-placementid="'+placementId+' data-testmode="true"></div>'
document.body.appendChild(adElemWrap);
setTimeout(function() {
window.fbAsyncInit = function() {
FB.Event.subscribe('ad.loaded', function(placementID) {
console.log('fb -> loaded: ',placementID);
@Shuky
Shuky / AppEngine restore specific namespace from cron backup
Created October 26, 2014 00:25
App-engine Backup Selective restoration - This script helps you restore only a specific namespace from an appengine cron backup for all namespaces
###
### This script helps you restore only a specific namespace from an appengine cron backup for all namespaces
###
# Make sure App Engine SDK is available
import sys
import cStringIO
import os
#sys.path.append('c:\\Program Files (x86)\\Google\\google_appengine')
#sys.path.append('c:\\Program Files (x86)\\Google\\google_appengine\\lib')

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after