Skip to content

Instantly share code, notes, and snippets.

View Anonyfox's full-sized avatar
🦀
Gopher, Rustacean & Alchemist

Maximilian Stroh Anonyfox

🦀
Gopher, Rustacean & Alchemist
View GitHub Profile
# These are my notes from the PragProg book on CoffeeScript of things that either
# aren't in the main CS language reference or I didn't pick them up there. I wrote
# them down before I forgot, and put it here for others but mainly as a reference for
# myself.
# assign arguments in constructor to properties of the same name:
class Thingie
constructor: (@name, @url) ->
# is the same as:
<snippet>
<content><![CDATA[
console.log(" /");
console.log(" .7");
console.log(" \\\ , //");
console.log(" |\\\.--._/|//");
console.log(" /\\\ ) ) ).'/");
console.log(" /( \\\ // /");
console.log(" /( J`((_/ \\\");
console.log(" / ) | _\\\ /");
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
function encrypt(text){
var cipher = crypto.createCipher('aes-256-cbc','d6F3Efeq')
var crypted = cipher.update(text,'utf8','hex')
crypted += cipher.final('hex');
return crypted;
}
function decrypt(text){
var decipher = crypto.createDecipher('aes-256-cbc','d6F3Efeq')
var dec = decipher.update(text,'hex','utf8')
@Anonyfox
Anonyfox / gist:32f4b599008b97500466
Last active April 29, 2018 23:39
nodejs file server example

Influenza, the minimalistic blogging engine.

Based on Node.js/Express.js and flat markdown files. This is the main (and only) code file, containing all the logic and code, and is written in literate Coffeescript. The Idea is that you just put your articles as markdown files (*.md) in the /posts folder, and Influenza takes care of all the other stuff.

Only the following npm modules are used:

express   = require "express"
exphbs    = require "express-handlebars"
@Anonyfox
Anonyfox / salesforce.exs
Created August 12, 2023 09:26
Call Salesforce Rest API with Elixir
# inspiration/guide: https://developer.sage.com/api/financials/how-to/configure-authentication/
defmodule Salesforce do
@user_email "XXX"
@user_password "XXX"
@client_id "XXX"
@client_secret "XXX"
def get_credentials() do
response = HTTPoison.post!(
"https://login.salesforce.com/services/oauth2/token",