Skip to content

Instantly share code, notes, and snippets.

View frekw's full-sized avatar
🐼

Fredrik Wärnsberg frekw

🐼
  • https://www.soundtrackyourbrand.com/
  • Stockholm, Sweden
  • 02:15 (UTC +02:00)
View GitHub Profile
@travisbrown
travisbrown / deusaquilus-deleted-tweets.md
Created November 8, 2021 04:34
Deleted tweets by Alexander Ioffe

Deleted tweets for deusaquilus

The list below includes 510 deleted tweets by deusaquilus.

There are also 3 tweets that are indicated as not currently deleted by the Twitter API that have been scraped from pages of deleted tweets (as replies, etc.). These possibly undeleted tweets are included for context and are indicated by a (live) link.

@macournoyer
macournoyer / Output
Last active January 9, 2023 15:12
A Neural Network framework in 25 LOC
$ python xor.py
Training:
Epoch 0 MSE: 1.765
Epoch 100 MSE: 0.015
Epoch 200 MSE: 0.005
* Target MSE reached *
Evaluating:
1 XOR 0 = 1 ( 0.904) Error: 0.096
0 XOR 1 = 1 ( 0.908) Error: 0.092
1 XOR 1 = 0 (-0.008) Error: 0.008
@jlongster
jlongster / kh.el
Last active October 28, 2015 20:23
(defun keynote-highlight ()
(interactive)
(shell-command-on-region
(region-beginning)
(region-end)
"highlight -O rtf --font-size 36 --font Inconsolata --style solarized-dark -W -J 50 -j 3 --src-lang ruby | pbcopy"))
const redux = require('./redux');
const ReactInstanceMap = require('react/lib/ReactInstanceMap');
function getIdFromInstance(instance) {
const internalInstance = ReactInstanceMap.get(instance);
return internalInstance ? internalInstance._rootNodeID : null;
}
function allocate(store, id, initialState) {
const atomState = store.getState();
@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@tkafka
tkafka / LICENSE.txt
Last active September 5, 2019 13:38
Drop-in replacement for ReactCSSTransitionGroup that uses velocity.js instead of CSS transforms. Add your own transitions to `transitions` hash.
The MIT License (MIT)
Copyright (c) 2014 Tomas Kafka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@orenbenkiki
orenbenkiki / enhanced_extension.ex
Last active February 21, 2022 22:29
Elixir module inheritance
defmodule Extension do
defmacro extends(module) do
# As above...
end
defmacro implements(module, protocol: protocol) do
quote do
defimpl unquote(protocol), for: unquote(module) do
import Extension
@kimroen
kimroen / high-dpi-media.scss
Created November 20, 2012 10:24 — forked from marcedwards/high-dpi-media.css
A Sass media query mixin that captures almost all high DPI aware devices.
/* ----------------------------------------------------------------------- */
/* */
/* Improved upon a mixin from 37signals and combined */
/* with these numbers from marc. */
/* */
/* 37signals-version: */
/* http://37signals.com/svn/posts/3271-easy-retina-ready-images-using-scss */
/* */
/* @kimroen */
/* */
@hxgdzyuyi
hxgdzyuyi / backbone-mixin.js
Created September 6, 2012 08:21 — forked from dmitry/backbone-mixin.js
Merge backbone views (mixin pattern)
define('backbone', ['lib-underscore', 'lib-backbone'], function () {
Backbone.mixin = function (view, mixin, custom) {
if (custom) {
if (custom.events && mixin.events) {
mixin = _.clone(mixin)
_.defaults(custom.events, mixin.events)
}
_.extend(mixin, custom)
}
var source = view.prototype || view