Skip to content

Instantly share code, notes, and snippets.

View nilsnh's full-sized avatar

Nils Norman Haukås nilsnh

View GitHub Profile
@Torthu
Torthu / pilsprog-roadmap-spring-2013.md
Created November 30, 2012 16:18 — forked from nilsnh/pilsprog-roadmap-spring-2013.md
A roadmap for pils & programmering spring 2013

Concepts:

  • Event med 50 oppmøtte!
  • Umbrella: Tv-show (will be marketed against NRK's kulturstripen) (looking for product owner)
  • FNL: Friday Night Lightning. The second Friday every month. roduct Owner: Eivind (Torstein skaffer rom)
  • SatHack: Hackathons (Snorre)
  • Rekruttering/PR
    • Snakke med fagutvalg (møte opp i introfag)
      • Infomedia/informatica
      • HiB
  • Informatikk
@arthuralvim
arthuralvim / Bibtex.sublime-build
Created June 1, 2012 15:13
Sublime Text 2 - build commands for bibtex and clean auxiliary files
// It's saved under path_to_Packages/User/
{
"cmd": ["bibtex", "$file_base_name"],
"path": "$PATH:/usr/texbin:/usr/local/bin",
"file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)",
"selector": "text.tex.latex"
}
@gatsbyjs-employees
gatsbyjs-employees / Open letter to the Gatsby community.md
Last active February 23, 2021 00:24
Open letter to the Gatsby community

To the Gatsby Community,

We want to start by specifically thanking Nat Alison. We support her and commend her bravery in speaking out. It is not easy to stand alone. What she experienced at Gatsby was unacceptable and speaks to wider issues. We thank her for putting pressure on the company to fix them. We vow to double down on those efforts.

While we have worked hard to give feedback and help create a healthy work environment over the past few years, change has been far too slow and the consequences have been real. The previous weeks have intensified the need for rapid change by increasing employee communication and allowing us to collectively connect some dots. We are just as outraged. As a result, we have posed a series of hard questions to management as well as a list of concrete actions they need to take.

Kyle Mathews' public apologies to both Nat Alison and Kim Crayton are small actions swiftly taken that signal the possibility for change but don't speak to the systemic issues that must be addressed.

@thomseddon
thomseddon / gist:3511330
Last active March 8, 2023 03:39
AngularJS byte format filter
app.filter('bytes', function() {
return function(bytes, precision) {
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
}
});
@peteheaney
peteheaney / craft-guzzle.twig
Last active March 24, 2023 18:17
Use Guzzle in a Craft CMS twig template. No need for a plugin!
{# Create Guzzle instance #}
{% set client = create({
'class': 'GuzzleHttp\\Client'
}) %}
{# Send API request #}
{% set response = client.request('GET', 'https://jsonplaceholder.typicode.com/posts') %}
{# Check the response status #}
{% set status = response.getStatusCode() %}
@rafaeltuelho
rafaeltuelho / checkpoint-snx-vpn-client-fedora25.txt
Last active June 30, 2023 15:19
setup Checkpoint Firewall VPN with SNX on Linux Fedora 25
First you have to ensure the Java JRE is installed on your system.
Remember the java plugin will only work on Firefox. If you prefer to install from fedora/rhel repos:
sudo dnf (yum) install java-1.8.0-openjdk icedtea-web
download the snx script installer from the Checkpoint VPN page:
https://<your company vpn ip addr>/sslvpn/SNX/INSTALL/snx_install.sh
run int as root to install
@chinshr
chinshr / Jenkinsfile
Last active October 16, 2023 09:25
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@domenkozar
domenkozar / autovpn.py
Created January 1, 2012 16:00 — forked from anonymous/autovpn.py
AutoVPN for NetworkManager
#!/usr/bin/env python
"""
Copyright 2011 Domen Kozar. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
@textarcana
textarcana / git-log2json.sh
Last active March 1, 2024 05:26
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features 😀THIS GIST NOW HAS A FULL GIT REPO: https://github.com/context-driven-testing-toolkit/git-log2json
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'