Skip to content

Instantly share code, notes, and snippets.

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Destination {
const Destination(this.index, this.title, this.icon, this.color);
final int index;
final String title;
final IconData icon;
final MaterialColor color;
}
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Destination {
const Destination(this.title, this.icon, this.color);
final String title;
final IconData icon;
final MaterialColor color;
}
@proteye
proteye / rsa.dart
Created July 15, 2018 14:46 — forked from ziizii/rsa.dart
How to generate RSA private/public key pair in Dart with Pointy Castle
import 'dart:html';
import 'dart:math';
import 'dart:typed_data';
import "package:bignum/bignum.dart";
import "package:pointycastle/export.dart";
void main() {
var keyParams = new RSAKeyGeneratorParameters(new BigInteger("65537"), 2048, 5);
@MatthewSteeples
MatthewSteeples / mousemove.ps1
Created February 26, 2015 19:09
Powershell Script to keep the mouse moving
Add-Type -AssemblyName System.Windows.Forms
while ($true)
{
$Pos = [System.Windows.Forms.Cursor]::Position
$x = ($pos.X % 500) + 1
$y = ($pos.Y % 500) + 1
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)
Start-Sleep -Seconds 10
}
using UnityEngine;
using UnityEngine.EventSystems;
namespace UnityEngine.EventSystems
{
public class MultiTouchInputModule : PointerInputModule
{
private PinchEventData _pinchData;
private RotateEventData _rotateData;
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active November 27, 2024 13:36
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@andre-morassut
andre-morassut / Readme.md
Last active August 14, 2021 19:48
Sublime Text - Text highlighting for writers

Sublime Text - Text highlighting for writers

What is it

A syntax definition for Sublime Text.

Not intened for a programming language but for prose writing. This enables :

  • highlighting for dialogs in a novel
  • Sections and titles highlights
  • Notes highlights
@JISyed
JISyed / MoveCameraInertia.cs
Last active August 31, 2022 09:26
Similar to MoveCamera.cs (https://gist.github.com/JISyed/5017805), except with inertia. This makes the camera gradually come to a smooth stop when stopping the camera movement.
// Credit to damien_oconnell from http://forum.unity3d.com/threads/39513-Click-drag-camera-movement
// for using the mouse displacement for calculating the amount of camera movement and panning code.
using UnityEngine;
using System.Collections;
public class MoveCamera : MonoBehaviour
{
//
@cliss
cliss / organize-photos.py
Created October 6, 2013 14:43
Photo management script. This script will copy photos from "~/Pictures/iPhone Incoming" into a tree the script creates, with folders representing month and years, and photo names timestamped. Completely based on the work of the amazing Dr. Drang; see here: http://www.leancrew.com/all-this/2013/10/photo-management-via-the-finder/ You can see more…
#!/usr/bin/python
import sys
import os, shutil
import subprocess
import os.path
from datetime import datetime
######################## Functions #########################
@scobal
scobal / draw_table
Created July 31, 2013 19:40
Pdfbox table with line wrapping and custom column widths
private void drawTable(PDPage page, PDPageContentStream contentStream, float y, float margin, String[][] content, float[] colWidths) throws IOException {
final int rows = content.length;
final int cols = content[0].length;
final float rowHeight = 40f;
final float tableWidth = page.findMediaBox().getWidth() - margin - margin;
final float tableHeight = rowHeight * rows;
final float colWidth = tableWidth/(float)cols;
final float cellMargin=5f;