Skip to content

Instantly share code, notes, and snippets.

View eivindml's full-sized avatar
🌱
Developing a new macOS app.

Eivind Lindbråten eivindml

🌱
Developing a new macOS app.
View GitHub Profile
@TheSwiftyCoder
TheSwiftyCoder / userDeviceChangeObserver.swift
Created January 24, 2017 13:39
Swift 3 Handling user device change
// Creates the notifcation constant
let notification = Notification.Name("NSSystemClockDidChangeNotification")
// Add this within your viewDidLoad()
NotificationCenter.default.addObserver(self, selector: #selector(handleTimeChange), name: notification, object: nil)
// Place this within the view controller where the above is added
@objc private func handleTimeChange() {
// Add anything you need in here
NotificationCenter.default.removeObserver(self, name: notification, object: nil);
@TorbenKoehn
TorbenKoehn / gulpfile.js
Created October 28, 2016 10:27
An example gulpfile.js to use Tale Jade with WordPress (or similar template engines)
var gulp = require('gulp'),
exec = require('gulp-exec');
var templateFiles = [
'wp-content/themes/my-theme/index.jade',
'wp-content/themes/my-theme/page.jade',
'wp-content/themes/my-theme/page-single.jade',
'wp-content/themes/my-theme/archive.jade',
//All other template files
@n8henrie
n8henrie / txt_to_reminders.applescript
Last active March 11, 2024 17:04
Demonstration of using AppleScript with Reminders.app
--taken from http://benguild.com/2012/04/11/how-to-import-tasks-to-do-items-into-ios-reminders/#comment-1346894559
--set theFileContents to (read file "Users:n8henrie:Desktop:Reminders.txt") -- Change this to the path to your downloaded text file with your tasks in it! (Note the : instead of a / between folders) Or, just name them Reminders.txt and put them in your downloads folder
--set theLines to paragraphs of theFileContents
set theLines to {"task name 1", "task name 2"}
repeat with eachLine in theLines
tell application "Reminders"
set mylist to list "Your List Name"
tell mylist
make new reminder at end with properties {name:eachLine, due date:date "7/10/2014 3:00 PM"}
@MikeAM
MikeAM / baseline-grid.scss
Last active May 12, 2017 17:58
Pure-CSS baseline grid with easily-customizable column count and baseline size (using Sass). No more uploading background images!
/* Sass Mixin that generates a Baseline Grid */
/* by: Mike Morrison, Soholaunch.com */
/* You don't have to leave this credit comment in, but it would be nice of you. */
// Set your grid dimensions here
$body-width: 960px;
$baseline: 22px;
@mixin baseline-grid {
$columns: 16;
$column-color: rgba(200,0,0,.2);
@jsoverson
jsoverson / device.css
Created February 15, 2013 20:06
Quick css hacks to target android/ios
.visible-android {
display:none;
}
.visible-ios {
display:none;
}
.on-device .visible-android, .on-device .visible-android {
display:inherit;
}
.device-ios .visible-android {
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@twosixcode
twosixcode / gist:1988097
Created March 6, 2012 18:40
Make "Paste and Indent" the default paste in Sublime Text 2
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }