Skip to content

Instantly share code, notes, and snippets.

##Some points to mention...
##
##The model knows nothing about the view or the controller.
##The view knows nothing about the controller or the model.
##The controller understands both the model and the view.
##
##The model uses observables, essentially when important data is changed,
##any interested listener gets notified through a callback mechanism.
##
##The following opens up two windows, one that reports how much money you
@natanfelles
natanfelles / theme_darcula.xml
Created June 13, 2016 14:48
gedit darcula theme
<?xml version="1.0" encoding="UTF-8"?>
<style-scheme id="darcula" _name="Darcula" version="1.0">
<author>Sash0k</author>
<_description>Dark color scheme using IntelliJ IDEA colors</_description>
<!-- Scribe Theme Generator 1.3 -->
<!-- COLORS -->
<color name="comment_color" value="#629755"/>
@RuGa
RuGa / massInsertOrUpdate.php
Last active December 11, 2024 23:14
Mass (bulk) insert or update on duplicate for Laravel 4/5
/**
* Mass (bulk) insert or update on duplicate for Laravel 4/5
*
* insertOrUpdate([
* ['id'=>1,'value'=>10],
* ['id'=>2,'value'=>60]
* ]);
*
*
* @param array $rows
@jo
jo / js-crypto-libraries.md
Last active January 16, 2025 12:08
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@alteist
alteist / thebat2mbox.py
Created September 6, 2013 10:09
This dirty script converts "The Bat!" mail databases to Unix mbox ones. It scans directory for .TBB files, reconstructs dir structure and converts databases using another program by Денис Трачук through wine.
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
thebat2mbox.py v0.1
Copyleft 2013 by [email protected]
This dirty script for *nix converts "The Bat!" mail databases to Unix mbox ones. It scans directory for .TBB files,
reconstructs dir structure and converts databases using another program by Денис Трачук through wine.
Usage:
@xeoncross
xeoncross / cryptojs.html
Last active October 28, 2024 14:58
Simple AES-256 password-based encryption using the CryptoJS Javascript library.
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title></title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" media="all" href=""/>
@aniljava
aniljava / FontFromBase64.java
Created May 11, 2012 07:50
Convert Base64 Encoded data to Font OTF/TTF
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.nio.ByteBuffer;
public class FontFromBase64 {
public static void main(String[] args) throws Exception {
String infile = "text.txt";